import Vue from 'vue'
import Router from 'vue-router'
import Axios from 'axios'
import List from '@/components/list'
import Index from '@/components/index'
import Success from '@/components/success'

Vue.prototype.$key = 'test123'

Axios.defaults.baseURL = 'http://huodongapi.zhongchoujia.com/'
Axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
Vue.prototype.$ajax = Axios

Vue.use(Router)

export default new Router({
  routes: [
		{ //重定向
			path:'/',
			redirect:{
				name:'list'
			}
		},
    {
      path: '/',
      name: 'list',
      component: List
    },
		{
			path: '/index',
			name: 'index',
			component: Index
		},
		{
			path: '/success',
			name: 'success',
			component: Success
		}
  ]
})
